/*! * Kakao SDK for JavaScript - v2.2.0 * * Copyright 2017 Kakao Corp. * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * * OSS Notice | KakaoSDK-JavaScript * * This application is Copyright © Kakao Corp. All rights reserved. * The following sets forth attribution notices for third party software that may be contained in this application. * If you have any questions about these notices, please email us at opensource@kakaocorp.com * * * crypto-js * * https://github.com/brix/crypto-js * * Copyright 2009-2013 Jeff Mott * Copyright 2013-2016 Evan Vosberg * * MIT License * * * ES6-Promise * * https://github.com/stefanpenner/es6-promise * * Copyright 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors * * MIT License * * * Kakao Web2App Library * * https://github.com/kakao/web2app * * Copyright 2015 Kakao Corp. http://www.kakaocorp.com * * MIT License * * * lodash * * https://github.com/lodash/lodash * * Copyright JS Foundation and other contributors * * MIT License * * * ua_parser * * https://github.com/html5crew/ua_parser * * Copyright HTML5 Tech. Team in Daum Communications Corp. * * MIT License * * * `````````` * MIT License * * Copyright (c) * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * `````````` */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Kakao=e.Kakao||{})}(this,(function(e){"use strict";var t="object"==typeof global&&global&&global.Object===Object&&global,n="object"==typeof self&&self&&self.Object===Object&&self,r=t||n||Function("return this")(),o=r.Symbol,i=Object.prototype,a=i.hasOwnProperty,c=i.toString,u=o?o.toStringTag:void 0;var s=Object.prototype.toString;var l="[object Null]",p="[object Undefined]",f=o?o.toStringTag:void 0;function d(e){return null==e?void 0===e?p:l:f&&f in Object(e)?function(e){var t=a.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=c.call(e);return r&&(t?e[u]=n:delete e[u]),o}(e):function(e){return s.call(e)}(e)}function h(e){return null!=e&&"object"==typeof e}var v="[object Symbol]";var m=Array.isArray,y=/\s/;var g=/^\s+/;function b(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&y.test(e.charAt(t)););return t}(e)+1).replace(g,""):e}function _(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var w=NaN,k=/^[-+]0x[0-9a-f]+$/i,S=/^0b[01]+$/i,j=/^0o[0-7]+$/i,O=parseInt;function x(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||h(e)&&d(e)==v}(e))return w;if(_(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=_(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=b(e);var n=S.test(e);return n||j.test(e)?O(e.slice(2),n?2:8):k.test(e)?w:+e}var A=1/0,T=17976931348623157e292;function C(e){var t=function(e){return e?(e=x(e))===A||e===-A?(e<0?-1:1)*T:e==e?e:0:0===e?e:0}(e),n=t%1;return t==t?n?t-n:t:0}function P(e){return e}var I="[object AsyncFunction]",B="[object Function]",E="[object GeneratorFunction]",z="[object Proxy]";function F(e){if(!_(e))return!1;var t=d(e);return t==B||t==E||t==I||t==z}var q,U=r["__core-js_shared__"],D=(q=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"";var R=Function.prototype.toString;var L=/^\[object .+?Constructor\]$/,M=Function.prototype,K=Object.prototype,N=M.toString,H=K.hasOwnProperty,G=RegExp("^"+N.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $(e){return!(!_(e)||(t=e,D&&D in t))&&(F(e)?G:L).test(function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}var J=Date.now;var W,X,V,Y=function(){try{var e=$(t=function(e,t){return null==e?void 0:e[t]}(Object,"defineProperty"))?t:void 0;return e({},"",{}),e}catch(e){}var t}(),Z=Y,Q=Z?function(e,t){return Z(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:P,ee=(W=Q,X=0,V=0,function(){var e=J(),t=16-(e-V);if(V=e,t>0){if(++X>=800)return arguments[0]}else X=0;return W.apply(void 0,arguments)}),te=ee;function ne(e,t){for(var n=-1,r=null==e?0:e.length;++n-1&&e%1==0&&e-1&&e%1==0&&e<=ue}function le(e){return null!=e&&se(e.length)&&!F(e)}var pe=Object.prototype;function fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||pe)}function de(e){return h(e)&&"[object Arguments]"==d(e)}var he=Object.prototype,ve=he.hasOwnProperty,me=he.propertyIsEnumerable,ye=de(function(){return arguments}())?de:function(e){return h(e)&&ve.call(e,"callee")&&!me.call(e,"callee")},ge=ye;var be="object"==typeof e&&e&&!e.nodeType&&e,_e=be&&"object"==typeof module&&module&&!module.nodeType&&module,we=_e&&_e.exports===be?r.Buffer:void 0,ke=(we?we.isBuffer:void 0)||function(){return!1},Se={};Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Arguments]"]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object Boolean]"]=Se["[object DataView]"]=Se["[object Date]"]=Se["[object Error]"]=Se["[object Function]"]=Se["[object Map]"]=Se["[object Number]"]=Se["[object Object]"]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object WeakMap]"]=!1;var je="object"==typeof e&&e&&!e.nodeType&&e,Oe=je&&"object"==typeof module&&module&&!module.nodeType&&module,xe=Oe&&Oe.exports===je&&t.process,Ae=function(){try{var e=Oe&&Oe.require&&Oe.require("util").types;return e||xe&&xe.binding&&xe.binding("util")}catch(e){}}(),Te=Ae&&Ae.isTypedArray,Ce=Te?function(e){return function(t){return e(t)}}(Te):function(e){return h(e)&&se(e.length)&&!!Se[d(e)]},Pe=Ce,Ie=Object.prototype.hasOwnProperty;function Be(e,t){var n=m(e),r=!n&&ge(e),o=!n&&!r&&ke(e),i=!n&&!r&&!o&&Pe(e),a=n||r||o||i,c=a?function(e,t){for(var n=-1,r=Array(e);++n2?t[2]:void 0;for(o&&function(e,t,n){if(!_(n))return!1;var r=typeof t;return!!("number"==r?le(n)&&ie(t,n.length):"string"==r&&t in n)&&ae(n[t],e)}(t[0],t[1],o)&&(r=1);++n1&&void 0!==arguments[1])||arguments[1]?encodeURIComponent:function(e){return e};return ft(vt(e),(function(n){var r=e[n];return t(n)+"="+t(h(r)?JSON.stringify(r):r)})).join("&")}function wt(e){if(!m(e))throw new Error("elements should be an Array");return function(t){return e.indexOf(t)>-1}}function kt(e){if(!m(e))throw new Error("validators should be an Array");return function(t){return e.some((function(e){return e(t)}))}}function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jt(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Et(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function zt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Pt(e);if(t){var o=Pt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Et(this,n)}}function Ft(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,t)||Ut(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qt(e){return function(e){if(Array.isArray(e))return Dt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ut(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ut(e,t){if(e){if("string"==typeof e)return Dt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dt(e,t):void 0}}function Dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1)return!0;return!1}(e)?"tablet":function(e){if(e.match(/linux|windows (nt|98)|macintosh|cros/)&&!e.match(/android|mobile|polaris|lgtelecom|uzard|natebrowser|ktf;|skt;/))return!0;return!1}(e)?"pc":function(e){return!!e.match(/ip(hone|od)|android.+mobile|windows (ce|phone)|blackberry|bb10|symbian|webos|firefox.+fennec|opera m(ob|in)i|tizen.+mobile|polaris|iemobile|lgtelecom|nokia|sonyericsson|dolfin|uzard|natebrowser|ktf;|skt;/)}(e)?"mobile":""}function r(e){var n={},r=/(iphone|ipad|ipod)[\S\s]*os ([\w._\-]+) like/.exec(e)||!!/polaris|natebrowser|([010|011|016|017|018|019]{3}\d{3,4}\d{4}$)/.test(e)&&["","polaris","0.0.0"]||/(windows)(?: nt | phone(?: os){0,1} | )([\w._\-]+)/.exec(e)||/(android)[ \/]([\w._\-]+);/.exec(e)||!!/android/.test(e)&&["","android","0.0.0"]||!!/(windows)/.test(e)&&["","windows","0.0.0"]||/(mac) os x ([\w._\-]+)/.exec(e)||/(tizen)[ \/]([\w._\-]+);/.exec(e)||!!/(linux)/.test(e)&&["","linux","0.0.0"]||!!/webos/.test(e)&&["","webos","0.0.0"]||/(cros)(?:\s[\w]+\s)([\d._\-]+)/.exec(e)||/(bada)[ \/]([\w._\-]+)/.exec(e)||!!/bada/.test(e)&&["","bada","0.0.0"]||!!/(rim|blackberry|bb10)/.test(e)&&["","blackberry","0.0.0"]||["","unknown","0.0.0"];return"iphone"===r[1]||"ipad"===r[1]||"ipod"===r[1]?r[1]="ios":"windows"===r[1]&&"98"===r[2]&&(r[2]="0.98.0"),"mac"===r[1]&&"undefined"!=typeof window&&window.navigator.maxTouchPoints>1&&(r[1]="ios"),"cros"===r[1]&&(r[1]="chrome"),n[r[1]]=!0,n.name=r[1],n.version=t(r[2]),n}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var o=["crios","fxios","daumapps"];function i(e,n){var r={},i=null,a=o;Array.isArray(n)?a=o.concat(n):"string"==typeof n&&(a=o.concat([n]));for(var c=0,u=a.length;c0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(!h(e))throw new Error("params should be an Object");F(t.before)&&t.before(e),F(t.defaults)?et(e,t.defaults(e)):et(e,t.defaults);var r=t.required,o=void 0===r?{}:r,i=t.optional,a=void 0===i?{}:i,c=ht(vt(o),vt(e));if(c.length>0)throw new un("Missing required keys: ".concat(c.join(",")," at ").concat(n));var u=jt(jt({},o),a),s=ht(vt(e),vt(u));if(s.length>0)throw new un("Invalid parameter keys: ".concat(s.join(",")," at ").concat(n));return tt(e,(function(e,t){!function(e,t,n){if(!1===t(e))throw new un("Illegal argument for ".concat(n))}(e,u[t],'"'.concat(t,'" in ').concat(n))})),F(t.after)&&t.after(e),e}function fn(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";return ft((window.crypto||window.msCrypto).getRandomValues(new Uint8Array(e)),(function(e){return t[e%66]})).join("")}function dn(e,t){if(Zt.os.android){var n=JSON.stringify({appKey:on,KA:nn});return"market://details?id=".concat(e,"&referrer=").concat(n)}return Zt.os.ios?"https://itunes.apple.com/app/id".concat(t):location.href}un.prototype=new Error;var hn={};function vn(e,t,n){var r=hn[t];return r&&r.close&&!r.closed&&r.close(),hn[t]=window.open(e,t,n),hn[t]}function mn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:480,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:700,n=window.screenLeft?window.screenLeft:window.screenX?window.screenX:0,r=window.screenTop?window.screenTop:window.screenY?window.screenY:0;return["width=".concat(e),"height=".concat(t),"left=".concat(screen.width/2-e/2+n),"top=".concat(screen.height/2-t/2+r),"scrollbars=yes","resizable=1"].join(",")}function yn(e,t,n){tt(n,(function(n,r){var o=t.getAttribute(n);null!==o&&(e[r]="true"===o||"false"===o?"true"===o:o)}))}function gn(e,t,n,r){var o=Zt.browser.msie?{}:vn(e,n,r||mn());return o.focus&&o.focus(),bn(e,t,n),o}function bn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"_self",r=document.createElement("form");r.setAttribute("accept-charset","utf-8"),r.setAttribute("method","post"),r.setAttribute("action",e),r.setAttribute("target",n),r.setAttribute("style","display:none"),tt(t,(function(e,t){var n=document.createElement("input");n.type="hidden",n.name=t,n.value=rt(e)?e:JSON.stringify(e),r.appendChild(n)})),document.body.appendChild(r),r.submit(),document.body.removeChild(r)}var _n={exports:{}};!function(e,t){e.exports=function(){function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,o=void 0,i=void 0,a=function(e,t){b[r]=e,b[r+1]=t,2===(r+=2)&&(i?i(_):k())};function c(e){i=e}function u(e){a=e}var s="undefined"!=typeof window?window:void 0,l=s||{},p=l.MutationObserver||l.WebKitMutationObserver,f="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){return function(){return process.nextTick(_)}}function v(){return void 0!==o?function(){o(_)}:g()}function m(){var e=0,t=new p(_),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function y(){var e=new MessageChannel;return e.port1.onmessage=_,function(){return e.port2.postMessage(0)}}function g(){var e=setTimeout;return function(){return e(_,1)}}var b=new Array(1e3);function _(){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((function(n){e.setRequestHeader(n,t[n])}))}(a,o),a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&t(a)},a.send(i)}(e,(function(e){var r=e.status,o=function(e){try{return JSON.parse(e)}catch(t){return e}}(e.response);200===r?t(o):n(o)}))}))}Mt(wn);var Sn={};var jn={subscribe:function(e,t){Sn[e]=Sn[e]||[],Sn[e].push(t)},unsubscribe:function(e,t){for(var n=Sn[e],r=0;rn._maxCount?t():(e(),n._doPolling(e,t))}),this._interval))}},{key:"stop",value:function(){this._stopped=!0,clearTimeout(this._timeout),this._timeout=null}}]),e}(),xn={optional:{close:F,returnUrl:rt,forceMobileLayout:ot,enableBackButton:ot},defaults:{close:mt,forceMobileLayout:!1,enableBackButton:!0}},An={authorize:{optional:{redirectUri:rt,approvalType:wt(["project"]),scope:rt,throughTalk:ot,channelPublicId:rt,serviceTerms:rt,isPopup:ot,state:rt,deviceType:wt(["watch","tv"]),prompts:rt,throughSyncplugin:ot,loginHint:rt,nonce:rt,settleId:rt},defaults:{throughTalk:!0,isPopup:!1,throughSyncplugin:!0}},selectShippingAddress:xn,createShippingAddress:xn,updateShippingAddress:jt({required:{addressId:at}},xn)};function Tn(e){return e.throughSyncplugin&&Qt&&/ch-home/i.test(Zt.ua)}function Cn(e,t){return!!(e&&e.indexOf(t)>-1)}function Pn(e){return"".concat(rn.authorize,"?").concat(_t(e))}function In(e){return jt(jt({},function(e){var t={client_id:an()};return e.approvalType&&(t.approval_type=e.approvalType),e.scope&&(t.scope=e.scope),e.prompts&&(t.prompt=e.prompts),e.state&&(t.state=e.state),e.nonce&&(t.nonce=e.nonce),e.loginHint&&(t.login_hint=e.loginHint),e.settleId&&(t.settle_id=e.settleId),e.deviceType&&(t.device_type=e.deviceType),e.channelPublicId&&(t.channel_public_id=e.channelPublicId),e.serviceTerms&&(t["extra.service_terms"]=e.serviceTerms),t}(e)),{},{redirect_uri:e.redirectUri||rn.redirectUri,response_type:"code",auth_tran_id:fn(60)})}function Bn(e,t){return jt(jt({},t),{},{ka:nn,is_popup:e.isPopup})}var En=["status","error_code"],zn=new On(1e3,600);function Fn(e){var t,n,r,o,i,a,c=In(e),u=Bn(e,c),s=(n=(t=e).prompts,r=t.throughTalk,o=!(!Zt.os.ios&&!Zt.os.android||Qt),i=Cn(n,"login"),a=Cn(n,"none"),r&&o&&!(Zt.os.android&&/instagram|fb_iab/g.test(Zt.ua))&&!i&&!a),l=Tn(e),p=Pn(u),f=s?function(e,t,n){var r=jt(jt({},t),{},{is_popup:!0}),o=function(){return["intent:#Intent","action=com.kakao.talk.intent.action.CAPRI_LOGGED_IN_ACTIVITY","launchFlags=0x08880000","S.com.kakao.sdk.talk.appKey=".concat(an()),"S.com.kakao.sdk.talk.redirectUri=".concat(r.redirect_uri),"S.com.kakao.sdk.talk.kaHeader=".concat(nn),"S.com.kakao.sdk.talk.extraparams=".concat(encodeURIComponent(JSON.stringify(r)))].concat(qt(e.state?["S.com.kakao.sdk.talk.state=".concat(e.state)]:[]),["S.browser_fallback_url=".concat(encodeURIComponent(n)),"end;"]).join(";")},i=function(){var t=Pn(r),o=e.isPopup?t:n,i="".concat(t,"&ka=").concat(encodeURIComponent(nn)),a="".concat(rn.talkInappScheme,"?url=").concat(encodeURIComponent(i));return"".concat(rn.universalKakaoLink).concat(encodeURIComponent(a),"&web=").concat(encodeURIComponent(o))};return Zt.os.android?o():i()}(e,c,p):p,d=null;return l?function(e){var t=jt(jt({},e),{},{is_popup:!0,approval_window_type:"v4_bizplugin"}),n=encodeURIComponent(_t(t));location.href="".concat(rn.talkSyncpluginScheme,"&query=").concat(n)}(u):e.isPopup?d=vn(f,"_blank",mn()):location.href=f,new wn.Promise((function(t,n){if(s||l||e.isPopup){var r=(o=c.auth_tran_id,{client_id:an(),auth_tran_id:o,ka:nn});zn.start((function(){var o;(o=r,kn({method:"GET",url:"".concat(rn.authDomain,"/apiweb/code.json?").concat(_t(o))})).then((function(r){var o=function(e){var t=e.status,n=e.error_code,r=Bt(e,En);if("300"===n)return null;"error"===t&&"700"===n&&(location.href="".concat(rn.authDomain,"/error/network"));return r}(r);null!==o&&(zn.stop(),d&&d.close&&d.close(),o.error?n(o):t(o),qn(e,o)),!s&&d&&d.closed&&zn.stop()}))}),(function(){var t=jt({error:"timeout",error_description:"LOGIN_TIMEOUT"},e.state&&{state:e.state});n(t),qn(e,t)}))}var o}))}function qn(e,t){var n=e.redirectUri;if(n){var r=n.indexOf("?")>-1?"&":"?";location.href=n+r+_t(t)}}var Un,Dn=Object.freeze({__proto__:null,authorize:function(e){if(Cn((e=pn(e,An.authorize,"Auth.authorize")).prompts,"none")&&!Qt){var t=jt({error:"auto_login",error_description:"NOT_SUPPORTED_BROWSER"},e.state&&{state:e.state});return qn(e,t),wn.Promise.reject(t)}var n,r,o,i;if(jn.dispatch("LOGIN_START"),r=(n=e).throughSyncplugin,o=n.isPopup,i=n.prompts,!Tn({throughSyncplugin:r})||!1!==o||Cn(i,"cert")||!window.kakaoweb||"function"!=typeof window.kakaoweb.reqSignInLocation)return Fn(e);(function(e){var t=In(e),n=Bn(e,t),r=_t(jt(jt({},n),{},{is_popup:!1,prompt:"none"}));return kakaoweb.reqSignInLocation(r).then((function(t){var n=Object.fromEntries(new window.URL(t).searchParams);return"consent_required"===n.error&&!Cn(e.prompts,"none")||"interaction_required"===n.error||(qn(e,n),!1)})).catch((function(e){return!1}))})(e).then((function(t){t&&Fn(e)}))}}),Rn={exports:{}},Ln={exports:{}};function Mn(){return Un||(Un=1,function(e,t){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==Lt&&Lt.crypto&&(n=Lt.crypto),!n)try{n=require("crypto")}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},a=i.lib={},c=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=c.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var c=0;c>>2]=n[c>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},p=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},d=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,c=i/(4*a),s=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*a,l=e.min(4*s,i);if(s){for(var p=0;p>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=e[t+0],u=e[t+1],d=e[t+2],h=e[t+3],v=e[t+4],m=e[t+5],y=e[t+6],g=e[t+7],b=e[t+8],_=e[t+9],w=e[t+10],k=e[t+11],S=e[t+12],j=e[t+13],O=e[t+14],x=e[t+15],A=i[0],T=i[1],C=i[2],P=i[3];A=s(A,T,C,P,a,7,c[0]),P=s(P,A,T,C,u,12,c[1]),C=s(C,P,A,T,d,17,c[2]),T=s(T,C,P,A,h,22,c[3]),A=s(A,T,C,P,v,7,c[4]),P=s(P,A,T,C,m,12,c[5]),C=s(C,P,A,T,y,17,c[6]),T=s(T,C,P,A,g,22,c[7]),A=s(A,T,C,P,b,7,c[8]),P=s(P,A,T,C,_,12,c[9]),C=s(C,P,A,T,w,17,c[10]),T=s(T,C,P,A,k,22,c[11]),A=s(A,T,C,P,S,7,c[12]),P=s(P,A,T,C,j,12,c[13]),C=s(C,P,A,T,O,17,c[14]),A=l(A,T=s(T,C,P,A,x,22,c[15]),C,P,u,5,c[16]),P=l(P,A,T,C,y,9,c[17]),C=l(C,P,A,T,k,14,c[18]),T=l(T,C,P,A,a,20,c[19]),A=l(A,T,C,P,m,5,c[20]),P=l(P,A,T,C,w,9,c[21]),C=l(C,P,A,T,x,14,c[22]),T=l(T,C,P,A,v,20,c[23]),A=l(A,T,C,P,_,5,c[24]),P=l(P,A,T,C,O,9,c[25]),C=l(C,P,A,T,h,14,c[26]),T=l(T,C,P,A,b,20,c[27]),A=l(A,T,C,P,j,5,c[28]),P=l(P,A,T,C,d,9,c[29]),C=l(C,P,A,T,g,14,c[30]),A=p(A,T=l(T,C,P,A,S,20,c[31]),C,P,m,4,c[32]),P=p(P,A,T,C,b,11,c[33]),C=p(C,P,A,T,k,16,c[34]),T=p(T,C,P,A,O,23,c[35]),A=p(A,T,C,P,u,4,c[36]),P=p(P,A,T,C,v,11,c[37]),C=p(C,P,A,T,g,16,c[38]),T=p(T,C,P,A,w,23,c[39]),A=p(A,T,C,P,j,4,c[40]),P=p(P,A,T,C,a,11,c[41]),C=p(C,P,A,T,h,16,c[42]),T=p(T,C,P,A,y,23,c[43]),A=p(A,T,C,P,_,4,c[44]),P=p(P,A,T,C,S,11,c[45]),C=p(C,P,A,T,x,16,c[46]),A=f(A,T=p(T,C,P,A,d,23,c[47]),C,P,a,6,c[48]),P=f(P,A,T,C,g,10,c[49]),C=f(C,P,A,T,O,15,c[50]),T=f(T,C,P,A,m,21,c[51]),A=f(A,T,C,P,S,6,c[52]),P=f(P,A,T,C,h,10,c[53]),C=f(C,P,A,T,w,15,c[54]),T=f(T,C,P,A,u,21,c[55]),A=f(A,T,C,P,b,6,c[56]),P=f(P,A,T,C,x,10,c[57]),C=f(C,P,A,T,y,15,c[58]),T=f(T,C,P,A,j,21,c[59]),A=f(A,T,C,P,v,6,c[60]),P=f(P,A,T,C,k,10,c[61]),C=f(C,P,A,T,d,15,c[62]),T=f(T,C,P,A,_,21,c[63]),i[0]=i[0]+A|0,i[1]=i[1]+T|0,i[2]=i[2]+C|0,i[3]=i[3]+P|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(r/4294967296),a=r;n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var c=this._hash,u=c.words,s=0;s<4;s++){var l=u[s];u[s]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return c},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function s(e,t,n,r,o,i,a){var c=e+(t&n|~t&r)+o+a;return(c<>>32-i)+t}function l(e,t,n,r,o,i,a){var c=e+(t&r|n&~r)+o+a;return(c<>>32-i)+t}function p(e,t,n,r,o,i,a){var c=e+(t^n^r)+o+a;return(c<>>32-i)+t}function f(e,t,n,r,o,i,a){var c=e+(n^(t|~r))+o+a;return(c<>>32-i)+t}t.MD5=i._createHelper(u),t.HmacMD5=i._createHmacHelper(u)}(Math),n.MD5)}(Rn);var Kn,Nn=Rn.exports,Hn=Mt(Nn),Gn={exports:{}},$n={exports:{}};function Jn(){return Kn||(Kn=1,function(e,t){var n;e.exports=(n=Mn(),function(){var e=n,t=e.lib.WordArray;function r(e,n,r){for(var o=[],i=0,a=0;a>>6-a%4*2;o[i>>>2]|=c<<24-i%4*8,i++}return t.create(o,i)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var o=[],i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,c=0;c<4&&i+.75*c>>6*(3-c)&63));var u=r.charAt(64);if(u)for(;o.length%4;)o.push(u);return o.join("")},parse:function(e){var t=e.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i>>31}var p=(r<<5|r>>>27)+u+c[s];p+=s<20?1518500249+(o&i|~o&a):s<40?1859775393+(o^i^a):s<60?(o&i|o&a|i&a)-1894007588:(o^i^a)-899497514,u=a,a=i,i=o<<30|o>>>2,o=r,r=p}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=i._createHelper(u),n.HmacSHA1=i._createHmacHelper(u),s.SHA1)}(Vn)),Vn.exports}var Zn,Qn,er={exports:{}};function tr(){return Qn||(Qn=1,function(e,t){var n;e.exports=(n=Mn(),Yn(),Zn||(Zn=1,function(e,t){var n;e.exports=(n=Mn(),void function(){var e=n,t=e.lib.Base,r=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,o=4*n;t.sigBytes>o&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),c=i.words,u=a.words,s=0;s>>2];e.sigBytes-=t}};r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,padding:h}),reset:function(){var e;l.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var v=r.CipherParams=o.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?i.create([1398893684,1701076831]).concat(n).concat(t):t).toString(u)},parse:function(e){var t,n=u.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=i.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),v.create({ciphertext:n,salt:t})}},y=r.SerializableCipher=o.extend({cfg:o.extend({format:m}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var o=e.createEncryptor(n,r),i=o.finalize(t),a=o.cfg;return v.create({ciphertext:i,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=i.random(8));var o=s.create({keySize:t+n}).compute(e,r),a=i.create(o.words.slice(t),4*n);return o.sigBytes=4*t,v.create({key:o,iv:a,salt:r})}},b=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:g}),encrypt:function(e,t,n,r){var o=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=o.iv;var i=y.encrypt.call(this,e,t,o.key,r);return i.mixIn(o),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var o=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=o.iv,y.decrypt.call(this,e,t,o.key,r)}})}()))}(rr)),function(){var e=n,t=e.lib.BlockCipher,r=e.algo,o=[],i=[],a=[],c=[],u=[],s=[],l=[],p=[],f=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var h=r^r<<1^r<<2^r<<3^r<<4;h=h>>>8^255&h^99,o[n]=h,i[h]=n;var v=e[n],m=e[v],y=e[m],g=257*e[h]^16843008*h;a[n]=g<<24|g>>>8,c[n]=g<<16|g>>>16,u[n]=g<<8|g>>>24,s[n]=g,g=16843009*y^65537*m^257*v^16843008*n,l[h]=g<<24|g>>>8,p[h]=g<<16|g>>>16,f[h]=g<<8|g>>>24,d[h]=g,n?(n=v^e[e[e[y^v]]],r^=e[e[r]]):n=r=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],v=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],a=0;a6&&a%n==4&&(s=o[s>>>24]<<24|o[s>>>16&255]<<16|o[s>>>8&255]<<8|o[255&s]):(s=o[(s=s<<8|s>>>24)>>>24]<<24|o[s>>>16&255]<<16|o[s>>>8&255]<<8|o[255&s],s^=h[a/n|0]<<24),i[a]=i[a-n]^s);for(var c=this._invKeySchedule=[],u=0;u>>24]]^p[o[s>>>16&255]]^f[o[s>>>8&255]]^d[o[255&s]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,c,u,s,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,p,f,d,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,i,a,c){for(var u=this._nRounds,s=e[t]^n[0],l=e[t+1]^n[1],p=e[t+2]^n[2],f=e[t+3]^n[3],d=4,h=1;h>>24]^o[l>>>16&255]^i[p>>>8&255]^a[255&f]^n[d++],m=r[l>>>24]^o[p>>>16&255]^i[f>>>8&255]^a[255&s]^n[d++],y=r[p>>>24]^o[f>>>16&255]^i[s>>>8&255]^a[255&l]^n[d++],g=r[f>>>24]^o[s>>>16&255]^i[l>>>8&255]^a[255&p]^n[d++];s=v,l=m,p=y,f=g}v=(c[s>>>24]<<24|c[l>>>16&255]<<16|c[p>>>8&255]<<8|c[255&f])^n[d++],m=(c[l>>>24]<<24|c[p>>>16&255]<<16|c[f>>>8&255]<<8|c[255&s])^n[d++],y=(c[p>>>24]<<24|c[f>>>16&255]<<16|c[s>>>8&255]<<8|c[255&l])^n[d++],g=(c[f>>>24]<<24|c[s>>>16&255]<<16|c[l>>>8&255]<<8|c[255&p])^n[d++],e[t]=v,e[t+1]=m,e[t+2]=y,e[t+3]=g},keySize:8});e.AES=t._createHelper(v)}(),n.AES)}(Gn);var or=Mt(Gn.exports),ir={exports:{}};!function(e,t){e.exports=Mn().enc.Utf8}(ir);var ar=Mt(ir.exports);function cr(){return an()}var ur=null;function sr(){var e,t,n,r;return null===ur&&(e=fr(),t=window.sessionStorage.getItem(e),ur=t?(n=t,r=cr(),or.decrypt(n,r).toString(ar)):null),ur}function lr(e){var t;ur=e,null===e||!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?(t=fr(),window.sessionStorage.removeItem(t)):function(e,t){var n=(r=t,o=cr(),or.encrypt(r,o).toString());var r,o;window.sessionStorage.setItem(e,n)}(fr(),e)}var pr={};function fr(){var e;return pr.accessTokenKey||(pr.accessTokenKey="kakao_"+(e="kat"+cr(),Hn(e).toString())),pr.accessTokenKey}var dr=Object.freeze({__proto__:null,getAccessToken:sr,getAppKey:cr,setAccessToken:lr});function hr(){return"Bearer ".concat(sr())}function vr(){return"KakaoAK ".concat(cr())}var mr={permission:wt(["A","F","M"]),enable_share:ot,android_exec_param:rt,ios_exec_param:rt,android_market_param:rt,ios_market_param:rt},yr={secure_resource:ot};function gr(e){!1===e.secure_resource&&(console&&console.warn("KakaoWarning: The secure_resource parameter is deprecated."),e.secure_resource=!0)}function br(e){if(!rt(e))return!1;if(0===e.length||e.length>2048)throw new un("content length should be between 0 and 2048");return!0}var _r={"/v1/user/signup":{method:"POST",data:{optional:{properties:h}}},"/v1/user/unlink":{method:"POST",data:{}},"/v2/user/me":{method:"GET",data:{optional:jt({property_keys:m},yr)}},"/v1/user/logout":{method:"POST",data:{}},"/v1/user/update_profile":{method:"POST",data:{required:{properties:h}}},"/v1/user/access_token_info":{method:"GET",data:{}},"/v2/user/scopes":{method:"GET",data:{optional:{scopes:m}}},"/v2/user/revoke/scopes":{method:"POST",data:{required:{scopes:m}}},"/v1/user/service/terms":{method:"GET",data:{optional:{extra:rt}}},"/v1/user/shipping_address":{method:"GET",data:{optional:{address_id:at,from_updated_at:at,page_size:at}}},"/v1/api/talk/profile":{method:"GET",data:{optional:yr,after:gr}},"/v1/api/talk/friends":{method:"GET",data:{optional:jt({offset:at,limit:at,order:rt,friend_order:rt},yr),after:gr}},"/v1/friends":{method:"GET",data:{optional:jt({offset:at,limit:at,order:rt,friend_order:rt},yr),after:gr}},"/v2/api/talk/memo/send":{method:"POST",data:{required:{template_id:at},optional:{template_args:h}}},"/v2/api/talk/memo/scrap/send":{method:"POST",data:{required:{request_url:rt},optional:{template_id:at,template_args:h}}},"/v2/api/talk/memo/default/send":{method:"POST",data:{required:{template_object:h}}},"/v1/api/talk/friends/message/send":{method:"POST",data:{required:{template_id:at,receiver_uuids:m,receiver_id_type:rt},optional:{template_args:h},defaults:{receiver_id_type:"uuid"}}},"/v1/api/talk/friends/message/scrap/send":{method:"POST",data:{required:{request_url:rt,receiver_uuids:m,receiver_id_type:rt},optional:{template_id:at,template_args:h},defaults:{receiver_id_type:"uuid"}}},"/v1/api/talk/friends/message/default/send":{method:"POST",data:{required:{template_object:h,receiver_uuids:m,receiver_id_type:rt},defaults:{receiver_id_type:"uuid"}}},"/v2/api/kakaolink/talk/template/validate":{method:"GET",data:{required:{link_ver:rt,template_id:at},optional:{template_args:h}},authType:vr},"/v2/api/kakaolink/talk/template/scrap":{method:"GET",data:{required:{link_ver:rt,request_url:rt},optional:{template_id:at,template_args:h}},authType:vr},"/v2/api/kakaolink/talk/template/default":{method:"GET",data:{required:{link_ver:rt,template_object:h}},authType:vr},"/v2/api/talk/message/image/upload":{method:"POST",data:{required:{file:h}},authType:vr},"/v2/api/talk/message/image/delete":{method:"DELETE",data:{required:{image_url:rt}},authType:vr},"/v2/api/talk/message/image/scrap":{method:"POST",data:{required:{image_url:rt}},authType:vr},"/v1/api/story/profile":{method:"GET",data:{optional:yr}},"/v1/api/story/isstoryuser":{method:"GET",data:{}},"/v1/api/story/mystory":{method:"GET",data:{required:{id:rt}}},"/v1/api/story/mystories":{method:"GET",data:{optional:{last_id:rt}}},"/v1/api/story/linkinfo":{method:"GET",data:{required:{url:rt}}},"/v1/api/story/post/note":{method:"POST",data:{required:{content:br},optional:mr}},"/v1/api/story/post/photo":{method:"POST",data:{required:{image_url_list:function(e){return!!m(e)&&dt(e,(function(e){if(!rt(e))return!1;if(/(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/.test(e))throw new un("url in image_url_list should be a kage url, obtained from '/v1/api/story/upload/multi'.");return!0}))}},optional:jt({content:br},mr)}},"/v1/api/story/post/link":{method:"POST",data:{required:{link_info:h},optional:jt({content:br},mr)}},"/v1/api/story/upload/multi":{method:"POST",data:{}},"/v1/api/story/delete/mystory":{method:"DELETE",data:{required:{id:rt}}},"/v1/api/talk/channels":{method:"GET",data:{optional:{channel_public_ids:m}}}},wr={apiRules:_r,request:{required:{url:wt(vt(_r))},optional:{data:h,files:function(e){return kt([m,pt])(e)&&dt(e,kt([lt,st]))},file:lt},defaults:{data:{}}}};function kr(e){var t=e=pn(e,wr.request,"API.request"),n=t.url,r=t.data,o=wr.apiRules[n].data;e.data=pn(r,o,"API.request - ".concat(n));var i=function(e){var t=wr.apiRules[e.url],n=t.method,r=t.authType,o=function(e){var t=e.url,n=e.data,r=e.files;if(function(e){return"/v1/api/story/upload/multi"===e||"/v2/api/talk/message/image/upload"===e}(t)||n.file){var o=r||n.file;if(!o)throw new un("'files' parameter should be set for ".concat(t));var i=new FormData;return tt(o,(function(e){return i.append("file",e)})),[null,i]}return["application/x-www-form-urlencoded",_t(n)]}(e),i=Ft(o,2),a=i[0],c=i[1],u=(f=rn.apiDomain+e.url,"POST"===n?[f,c]:["".concat(f,"?").concat(c),null]),s=Ft(u,2),l=s[0],p=s[1];var f;return{url:l,method:n,headers:jt(jt({},a&&{"Content-Type":a}),{},{KA:nn,Authorization:(r||hr)(),"Cache-Control":"no-cache, no-store, max-age=0, must-revalidate",Pragma:"no-cache"}),data:p}}(e);return kn(i)}var Sr=Object.freeze({__proto__:null,request:kr});var jr=Object.freeze({__proto__:null,getStatusInfo:function(){return sr()?kr({url:"/v2/user/me"}).then((function(e){return{status:"connected",user:e}})).catch((function(){return{status:"not_connected"}})):wn.Promise.reject({status:"not_connected"})},logout:function(){return kr({url:"/v1/user/logout"}).finally((function(){lr(null),jn.dispatch("LOGOUT")}))}}),Or=function(){function e(t){Ot(this,e),this.domain=t}return At(e,[{key:"createHiddenIframe",value:function(e,t){this.iframe&&this.destroy(!0);var n=document.createElement("iframe");n.id=n.name=e,n.src=this.domain+t,n.setAttribute("style","border:none; width:0; height:0; display:none; overflow:hidden;"),document.body.appendChild(n),this.iframe=n}},{key:"retrieveMessage",value:function(e,t,n){var r=this;return this.popup=gn(this.domain+e,t,n),new wn.Promise((function(e,t){r.callback=function(n){var o=n.data,i=n.origin;if(o&&i===r.domain)try{var a=JSON.parse(o);a.code?t(a):e(a)}catch(e){bt(window,"message",r.callback)}},gt(window,"message",r.callback),r.interval=setInterval((function(){return r.destroy()}),1e3)}))}},{key:"destroy",value:function(){(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||this.popup&&this.popup.closed)&&(clearInterval(this.interval),bt(window,"message",this.callback),document.body.removeChild(this.iframe),this.iframe=null)}}]),e}();var xr=new Or(rn.appsDomain);function Ar(e,t){var n,r,o=fn(60),i=jt({app_key:an(),access_token:sr(),ka:nn,trans_id:o,mobile_view:e.forceMobileLayout,enable_back_button:e.enableBackButton},e.addressId&&{address_id:e.addressId});if(!e.returnUrl)return n=e.close,r=function e(t){var r=t.data,o=t.origin;o!==rn.appsDomain&&o!==rn.accountDomain||"closed"!==r||(n(),bt(window,"message",e))},gt(window,"message",r),xr.createHiddenIframe(o,"/proxy?trans_id=".concat(o)),xr.retrieveMessage(t,i,"shipping_address");i.return_url=e.returnUrl,bn(rn.appsDomain+t,i)}var Tr=sn([Dn,dr,jr,Object.freeze({__proto__:null,createShippingAddress:function(e){return Ar(e=pn(e,An.createShippingAddress,"Auth.createShippingAddress"),"/user/create/address")},selectShippingAddress:function(e){return Ar(e=pn(e,An.selectShippingAddress,"Auth.selectShippingAddress"),"/user/address")},updateShippingAddress:function(e){return Ar(e=pn(e,An.updateShippingAddress,"Auth.updateShippingAddress"),"/user/edit/address")}})]),Cr=sn([Sr]);function Pr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ir(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))}function Br(e){return h(e)?JSON.stringify(e):e}function Er(e,t){return kr({url:e,data:t})}function zr(e,t,n){return pn(e,t,'parameter "'.concat(n,'" in Share')),!0}function Fr(e){return vt(e).reduce((function(t,n){return t[Ir(n)]=e[n],t}),{})}var qr={optional:{webUrl:rt,mobileWebUrl:rt,androidExecutionParams:rt,iosExecutionParams:rt},builder:Fr},Ur={required:{item:rt,itemOp:rt}};function Dr(e){return{title:e.title,link:Fr(e.link)}}function Rr(e){var t=Fr(e);return t.link=Fr(t.link),t}var Lr={headerLink:qr,link:qr,button:{required:{title:rt,link:function(e){zr(e,qr,"link")}},builder:Dr},buttons:{optional:{0:function(e){zr(e,Lr.button,"button")},1:function(e){zr(e,Lr.button,"button")}},builder:function(e){return ft(e,Dr)}},content:{required:{title:rt,imageUrl:rt,link:function(e){zr(e,qr,"link")}},optional:{imageWidth:at,imageHeight:at,description:rt},builder:Rr},contents:{optional:{0:function(e){zr(e,Lr.content,"content")},1:function(e){zr(e,Lr.content,"content")},2:function(e){zr(e,Lr.content,"content")}},builder:function(e){return ft(e,Rr)}},commerce:{required:{regularPrice:at},optional:{discountPrice:at,discountRate:at,fixedDiscountPrice:at,currencyUnit:rt,currencyUnitPosition:wt([0,1]),productName:rt},builder:Fr},social:{optional:{likeCount:at,commentCount:at,sharedCount:at,viewCount:at,subscriberCount:at},builder:Fr},itemContent:{optional:{profileText:rt,profileImageUrl:rt,titleImageUrl:rt,titleImageText:rt,titleImageCategory:rt,items:function(e){return m(e)&&e.length<6&&dt(e,(function(e){return zr(e,Ur,"items.item")}))},sum:rt,sumOp:rt},builder:function(e){var t=Fr(e);return t.items&&(t.items=ft(t.items,(function(e){return Fr(e)}))),t}}};var Mr={create:function(e,t,n){var r=Lr[t];if(r)return e=pn(e,r,'parameter "'.concat(t,'" in ').concat(n||"Share")),r.builder(e)}},Kr="4.0",Nr=At((function e(t,n){Ot(this,e),this.appkey=an(),this.appver="1.0",this.linkver=Kr,this.extras=jt(jt({KA:nn},t.extras),t.serverCallbackArgs&&{lcba:Br(t.serverCallbackArgs)}),this.template_json=n.template_msg,this.template_args=n.template_args,this.template_id=n.template_id}));var Hr=At((function e(t){var n=this;Ot(this,e),this.link_ver=Kr,this.template_object=jt({object_type:t.objectType},t.buttonTitle&&{button_title:t.buttonTitle}),tt(t,(function(e,t){var r=Mr.create(e,t,"defaultObject");r&&(n.template_object[Ir(t)]=r)}))})),Gr={FeedLink:Hr,CommerceLink:Hr,ListLink:function(e){Ct(n,e);var t=zt(n);function n(e){var r;return Ot(this,n),(r=t.call(this,e)).template_object.header_title=e.headerTitle,r}return At(n)}(Hr),LocationLink:function(e){Ct(n,e);var t=zt(n);function n(e){var r;return Ot(this,n),(r=t.call(this,e)).template_object.address=e.address||"",r.template_object.address_title=e.addressTitle||"",r}return At(n)}(Hr),CalendarLink:function(e){Ct(n,e);var t=zt(n);function n(e){var r;return Ot(this,n),(r=t.call(this,e)).template_object.id_type=e.idType||"",r.template_object.id=e.id||"",r}return At(n)}(Hr),TextLink:function(e){Ct(n,e);var t=zt(n);function n(e){var r;return Ot(this,n),(r=t.call(this,e)).template_object.text=e.text||"",r}return At(n)}(Hr)},$r=At((function e(t){Ot(this,e),this.link_ver=Kr,this.request_url=t.requestUrl,t.templateId&&(this.template_id=t.templateId),t.templateArgs&&(this.template_args=t.templateArgs)})),Jr=At((function e(t){Ot(this,e),this.link_ver=Kr,this.template_id=t.templateId,this.template_args=t.templateArgs}));var Wr={send:function(e,t,n){var r=jt({app_key:an(),ka:nn,validation_action:t,validation_params:JSON.stringify(n)},e.serverCallbackArgs&&{lcba:Br(e.serverCallbackArgs)}),o=gn("".concat(rn.sharerDomain,"/picker/link"),r,"sharer");e.callback&&(console&&console.warn('KakaoWarning: The "callback" parameter is deprecated.'),function(e,t){if(Zt.browser.msie)return void(console&&console.warn('KakaoWarning: The "callback" parameter does not support the IE browser.'));var n=function(e){"sent"===e.data&&e.origin===rn.sharerDomain&&t()};gt(window,"message",n);var r=setInterval((function(){e.closed&&(clearInterval(r),bt(window,"message",n))}),1e3)}(o,e.callback))}},Xr=Mt(function(){var e=5e3,t=300,n=100,r=Kt(),o=r.os,i=["opr/"],a=["firefox","KAKAOTALK"];function c(e){window.top.location.href=e}function u(e,t,r){var o=(new Date).getTime();return setTimeout((function(){var i=(new Date).getTime();s()&&i-o=25,h=new RegExp(i.join("|"),"i"),v=new RegExp(a.join("|"),"i"),(d&&!h.test(r.ua)||v.test(r.ua))&&n.intentURI&&!n.useUrlScheme?function(e){r.browser.chrome?t():setTimeout(t,100);function t(){top.location.href=e}}(n.intentURI):n.storeURL&&(p=n.urlScheme,f=n.storeURL,u(t,f,y),l(p))):o.ios&&n.storeURL?function(t,n,o,i){var a=u(e,n,o);parseInt(r.os.version.major,10)<8?function(e){window.addEventListener("pagehide",(function t(){s()&&(clearTimeout(e),window.removeEventListener("pagehide",t))}))}(a):function(e){document.addEventListener("visibilitychange",(function t(){s()&&(clearTimeout(e),document.removeEventListener("visibilitychange",t))}))}(a);parseInt(r.os.version.major,10)>8&&r.os.ios?(void 0===i?i=t:clearTimeout(a),function(e){window.top.location.href=e}(i)):l(t)}(n.urlScheme,n.storeURL,y,n.universalLink):setTimeout((function(){g()}),100)}}());function Vr(){return Zt.os.android&&(2==Zt.os.version.major&&/Version\/\d+.\d+|/i.test(Zt.ua)||4==Zt.os.version.major&&Zt.os.version.minor<4&&/Version\/\d+.\d+|/i.test(Zt.ua)||/Version\/\d+\.\d+/i.test(Zt.ua)&&(/Chrome\/\d+\.\d+\.\d+\.\d+ Mobile/i.test(Zt.ua)||/; wv\)/i.test(Zt.ua)))}function Yr(){return Zt.os.ios&&Qt}var Zr="362057947";var Qr={send:function(e,t,n){return Er(t,n).then((function(t){var n=function(e,t){var n=new Nr(e,t);if(JSON.stringify(n).length>1e4)throw new un("Failed to send message because it exceeds the message size limit. Please contact the app administrator.");return _t(n)}(e,t);!function(e,t){var n="".concat(Zt.os.ios?rn.talkLinkScheme:"kakaolink://send","?").concat(e),r=["intent://send?".concat(e,"#Intent"),"scheme=kakaolink","launchFlags=0x14008000"].concat(qt(t?["package=".concat(rn.talkAndroidPackage)]:[]),["end;"]).join(";"),o=jt(jt({},!Yr()&&{universalLink:rn.universalKakaoLink+encodeURIComponent(n)}),{},{urlScheme:n,intentURI:r,appName:"KakaoTalk",storeURL:dn(rn.talkAndroidPackage,Zr),onUnsupportedEnvironment:function(){throw new un("unsupported environment")}});(!t||Yr()||Vr())&&(o.onAppMissing=mt);try{Xr(o)}catch(e){}}(n,e.installTalk)})).catch((function(e){var t,n=JSON.stringify(jt({name:"KAPIError"},e));location.href="".concat(rn.sharerDomain,"/picker/failed?app_key=").concat(an(),"&error=").concat((t=n,window.btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")))}))}},eo={callback:F,installTalk:ot,throughTalk:ot,extras:h,serverCallbackArgs:kt([function(e){try{JSON.parse(e)}catch(e){return!1}return!0},h])},to={installTalk:!1,throughTalk:!0};function no(e){if(!m(e))return!1;if(e.length>2)throw new un('Illegal argument for "buttons" in Share: size of buttons should be up to 2');return!0}var ro={required:{objectType:function(e){return"feed"===e},content:h},optional:jt(jt({},eo),{},{itemContent:h,social:h,buttonTitle:rt,buttons:no}),defaults:to},oo={required:{objectType:function(e){return"list"===e},headerTitle:rt,headerLink:h,contents:function(e){if(!m(e))return!1;if(e.length<2||e.length>3)throw new un('Illegal argument for "contents" in Share: size of contents should be more than 1 and up to 3');return!0}},optional:jt(jt({},eo),{},{buttonTitle:rt,buttons:no}),defaults:to},io={required:{objectType:function(e){return"commerce"===e},content:h,commerce:h},optional:jt(jt({},eo),{},{buttonTitle:rt,buttons:no}),defaults:to},ao={required:{objectType:function(e){return"location"===e},content:h,address:rt},optional:jt(jt({},eo),{},{addressTitle:rt,social:h,buttonTitle:rt,buttons:no}),defaults:to},co={required:{objectType:function(e){return"calendar"===e},idType:wt(["event","calendar"]),id:rt,content:h},optional:jt(jt({},eo),{},{buttons:no}),defaults:to},uo={required:{objectType:function(e){return"text"===e},text:rt,link:h},optional:jt(jt({},eo),{},{buttonTitle:rt,buttons:no}),defaults:to},so={required:{requestUrl:rt},optional:jt(jt({},eo),{},{templateId:at,templateArgs:h}),defaults:jt(jt({},to),{},{templateArgs:{}})},lo={required:{templateId:at},optional:jt(jt({},eo),{},{templateArgs:h}),defaults:jt(jt({},to),{},{templateArgs:{}})};function po(e){return et({required:jt(jt({},e.required),{},{container:kt([it,rt])})},e)}var fo={objectTypes:["feed","list","commerce","location","calendar","text"],sendFeed:ro,createFeedButton:po(ro),sendList:oo,createListButton:po(oo),sendCommerce:io,createCommerceButton:po(io),sendLocation:ao,createLocationButton:po(ao),sendCalendar:co,createCalendarButton:po(co),sendText:uo,createTextButton:po(uo),sendScrap:so,createScrapButton:po(so),sendCustom:lo,createCustomButton:po(lo),uploadImage:{required:{file:h}},deleteImage:{required:{imageUrl:rt}},scrapImage:{required:{imageUrl:rt}}};function ho(e,t){var n=yt(e.container);if(!n)throw new un("container is required for KakaoTalk sharing: pass in element or id");var r=function(n){n.preventDefault(),n.stopPropagation(),mo(e,t)};gt(n,"click",r),yo.push((function(){bt(n,"click",r)}))}var vo={default:[function(e){return new(0,Gr["".concat(Pr(e.objectType),"Link")])(e)},"/v2/api/kakaolink/talk/template/default"],scrap:[function(e){return new $r(e)},"/v2/api/kakaolink/talk/template/scrap"],custom:[function(e){return new Jr(e)},"/v2/api/kakaolink/talk/template/validate"]};function mo(e,t){var n,r,o,i,a=Ft(vo[t],2),c=a[0],u=a[1],s=c(e);n=e.throughTalk,r=/opr\/|opt\/|huawei/g.test(Zt.ua),o=Zt.os.ios&&"tablet"===Zt.platform,i=!r&&("mobile"===Zt.platform||o),Qt||n&&i?Qr.send(e,u,s):Wr.send(e,t,s)}var yo=[];var go=sn([Object.freeze({__proto__:null,cleanup:function(){ln(yo)},createCustomButton:function(e){ho(e=pn(e,fo.createCustomButton,"Share.createCustomButton"),"custom")},createDefaultButton:function(e){if(!e.objectType||!wt(fo.objectTypes)(e.objectType))throw new un("objectType should be one of (".concat(fo.objectTypes.join(", "),")"));ho(e=pn(e,fo["create".concat(Pr(e.objectType),"Button")],"Share.createDefaultButton"),"default")},createScrapButton:function(e){ho(e=pn(e,fo.createScrapButton,"Share.createScrapButton"),"scrap")},sendCustom:function(e){mo(e=pn(e,fo.sendCustom,"Share.sendCustom"),"custom")},sendDefault:function(e){if(!e.objectType||!wt(fo.objectTypes)(e.objectType))throw new un("objectType should be one of (".concat(fo.objectTypes.join(", "),")"));mo(e=pn(e,fo["send".concat(Pr(e.objectType))],"Share.sendDefault"),"default")},sendScrap:function(e){mo(e=pn(e,fo.sendScrap,"Share.sendScrap"),"scrap")}}),Object.freeze({__proto__:null,deleteImage:function(e){return Er("/v2/api/talk/message/image/delete",{image_url:(e=pn(e,fo.deleteImage,"Share.deleteImage")).imageUrl})},scrapImage:function(e){return Er("/v2/api/talk/message/image/scrap",{image_url:(e=pn(e,fo.scrapImage,"Share.scrapImage")).imageUrl})},uploadImage:function(e){return Er("/v2/api/talk/message/image/upload",{file:(e=pn(e,fo.uploadImage,"Share.uploadImage")).file})}})]),bo=["small","large"],_o=["yellow","mono"],wo=["pc","mobile"],ko=["consult","question"],So=["ko","en","ja"];function jo(e){return rt(e)&&!/(.{1,2}\/)/g.test(e)}var Oo={createAddChannelButton:{required:{container:kt([it,rt]),channelPublicId:jo},optional:{size:wt(bo),lang:wt(So),supportMultipleDensities:ot},defaults:{size:bo[0],supportMultipleDensities:!1}},addChannel:{required:{channelPublicId:jo},optional:{lang:wt(So)}},createChatButton:{required:{container:kt([it,rt]),channelPublicId:jo},optional:{size:wt(bo),color:wt(_o),shape:wt(wo),title:wt(ko),lang:wt(So),supportMultipleDensities:ot},defaults:{size:bo[0],color:_o[0],shape:wo[0],title:ko[0],supportMultipleDensities:!1}},chat:{required:{channelPublicId:jo},optional:{lang:wt(So)}}},xo="1.1",Ao="channel_add_social_plugin",To="channel_chat_social_plugin";function Co(e){var t="".concat(rn.channel,"/").concat(e.channelPublicId,"/friend");null!==an()&&(t+="?".concat(Io(xo,e.lang))),vn(t,Ao,mn(350,510))}function Po(e){var t="".concat(rn.channel,"/").concat(e.channelPublicId,"/chat");null!==an()&&(t+="?".concat(Io(xo,e.lang))),vn(t,To,mn(350,510))}function Io(e,t){return _t(jt({api_ver:e,kakao_agent:nn,app_key:an(),referer:Yt+location.pathname+location.search},t&&{lang:t}))}function Bo(e,t,n){var r=document.createElement("a");r.setAttribute("href","#");var o=document.createElement("img");return o.setAttribute("src",t),o.setAttribute("title",n),o.setAttribute("alt",n),e.supportMultipleDensities&&o.setAttribute("srcset",[t.replace(".png","_2X.png 2x"),t.replace(".png","_3X.png 3x")].join(", ")),r.appendChild(o),r}var Eo=[];var zo=sn([Object.freeze({__proto__:null,addChannel:function(e){Co(e=pn(e,Oo.addChannel,"Channel.addChannel"))},chat:function(e){Po(e=pn(e,Oo.chat,"Channel.chat"))},cleanup:function(){ln(Eo)},createAddChannelButton:function(e){var t=yt(e.container);if(!t)throw new un("container is required for Channel.createAddChannelButton: pass in element or id");yn(e,t,{channelPublicId:"data-channel-public-id",size:"data-size",supportMultipleDensities:"data-support-multiple-densities"});var n=function(e){var t="friendadd_".concat(e.size,"_yellow_rect.png");return"".concat(rn.channelIcon,"/channel/").concat(t)}(e=pn(e,Oo.createAddChannelButton,"Channel.createAddChannelButton")),r=Bo(e,n,"카카오톡 채널 추가 버튼");t.appendChild(r);var o=function(t){t.preventDefault(),Co(e)};gt(r,"click",o),Eo.push((function(){bt(r,"click",o),t.removeChild(r)}))},createChatButton:function(e){var t=yt(e.container);if(!t)throw new un("container is required for Channel.createChatButton: pass in element or id");yn(e,t,{channelPublicId:"data-channel-public-id",size:"data-size",color:"data-color",shape:"data-shape",title:"data-title",supportMultipleDensities:"data-support-multiple-densities"});var n=function(e){var t="".concat(e.title,"_").concat(e.size,"_").concat(e.color,"_").concat(e.shape,".png");return"".concat(rn.channelIcon,"/channel/").concat(t)}(e=pn(e,Oo.createChatButton,"Channel.createChatButton")),r=Bo(e,n,"카카오톡 채널 1:1 채팅 버튼");t.appendChild(r);var o=function(t){t.preventDefault(),Po(e)};gt(r,"click",o),Eo.push((function(){bt(r,"click",o),t.removeChild(r)}))}})]),Fo={required:{title:rt},optional:{desc:rt,name:rt,images:m,type:rt},defaults:{type:"website"},after:function(e){e.images&&(e.imageurl=e.images,delete e.images)}},qo={createShareButton:{required:{container:kt([it,rt])},optional:{url:rt,text:rt},defaults:{url:location.href}},share:{optional:{url:rt,text:rt},defaults:{url:location.href}},open:{optional:{url:rt,text:rt,urlInfo:function(e){return h(e)&&!!pn(e,Fo,"Story.open")},install:ot},defaults:{url:location.href,install:!1}},createFollowButton:{required:{container:kt([it,rt]),id:rt},optional:{showFollowerCount:ot,type:wt(["horizontal","vertical"])},defaults:{showFollowerCount:!0,type:"horizontal"},after:function(e){"@"!==e.id[0]&&(e.id="@".concat(e.id))}}};function Uo(e){var t=jt(jt({},Ro()),{},{url:e.url});e.text&&(t.text=e.text),vn("".concat(rn.storyShare,"?").concat(_t(t)),"kakaostory_social_plugin",mn())}var Do=0;function Ro(){var e={kakao_agent:nn};return null!==an()&&(e.app_key=an()),e}var Lo=[];var Mo=sn([Object.freeze({__proto__:null,cleanup:function(){ln(Lo)},createFollowButton:function(e){var t=yt(e.container);if(!t)throw new un("container is required for Story.createFollowButton: pass in element or id");yn(e,t,{id:"data-id",showFollowerCount:"data-show-follower-count",type:"data-type"});var n=function(e){var t=Do++,n=e.showFollowerCount&&"horizontal"===e.type?85:59,r=e.showFollowerCount&&"vertical"===e.type?46:20,o=document.createElement("iframe");o.src=function(e,t){var n=jt(jt({},Ro()),{},{id:e.id,type:e.type,hideFollower:!e.showFollowerCount,frameId:t});return"".concat(rn.storyChannelFollow,"?").concat(_t(n))}(e,t),o.setAttribute("frameborder","0"),o.setAttribute("marginwidth","0"),o.setAttribute("marginheight","0"),o.setAttribute("scrolling","no"),o.setAttribute("style","width:".concat(n,"px; height:").concat(r,"px;"));var i=function(e){if(e.data&&/\.kakao\.com$/.test(e.origin)&&"string"==typeof e.data){var i=Ft(ft(e.data.split(","),(function(e){return parseInt(e,10)})),3),a=i[0],c=i[1],u=i[2];a===t&&(n!==c&&(o.style.width="".concat(c,"px")),r!==u&&(o.style.height="".concat(u,"px")))}};return{iframe$:o,messageHandler:i}}(e=pn(e,qo.createFollowButton,"Story.createFollowButton")),r=n.iframe$,o=n.messageHandler;t.appendChild(r),gt(window,"message",o),Lo.push((function(){bt(window,"message",o),t.removeChild(r)}))},createShareButton:function(e){var t=yt(e.container);if(!t)throw new un("container is required for Story.createShareButton: pass in element or id");yn(e,t,{url:"data-url"}),e=pn(e,qo.createShareButton,"Story.createShareButton");var n=function(e,t){var n=document.createElement("a");n.setAttribute("href","#");var r=document.createElement("img");return r.setAttribute("src",e),r.setAttribute("title",t),r.setAttribute("alt",t),n.appendChild(r),n}(rn.storyIcon,"카카오스토리 웹 공유 버튼");t.appendChild(n);var r=function(t){t.preventDefault(),Uo(e)};gt(n,"click",r),Lo.push((function(){bt(n,"click",r),t.removeChild(n)}))},open:function(e){var t=function(e){var t=location.hostname||"",n=jt(jt({},Ro()),{},{apiver:"1.0",appver:en,appid:t,appname:t,post:e.text?"".concat(e.text,"\n").concat(e.url):e.url});e.urlInfo&&(n.urlinfo=JSON.stringify(e.urlInfo),n.appname=e.urlInfo.name||n.appname);return"".concat(rn.storyPostScheme,"?").concat(_t(n))}(e=pn(e,qo.open,"Story.open")),n={urlScheme:t,intentURI:["intent:".concat(t,"#Intent"),"".concat(e.install?"package=com.kakao.story;":"","end;")].join(";"),appName:"KakaoStory",storeURL:dn("com.kakao.story","486244601"),onUnsupportedEnvironment:function(){e.fail&&e.fail()}};try{Xr(n)}catch(e){}},share:function(e){Uo(e=pn(e,qo.share,"Story.share"))}})]),Ko=["wgs84","katec"],No={required:{name:rt,x:ct,y:ct},optional:{rpflag:rt,cid:rt}},Ho={start:{required:{name:rt,x:ct,y:ct},optional:{coordType:wt(Ko),vehicleType:wt([1,2,3,4,5,6,7]),rpOption:wt([1,2,3,4,5,6,8,100]),routeInfo:ot,sX:ct,sY:ct,sAngle:ct,returnUri:rt,rpflag:rt,cid:rt,guideId:ct,viaPoints:function(e){if(m(e)){if(e.length>3)throw new un("Invalid parameter keys: via points should not be exceed 3. at Navi.start");return tt(e,(function(e){return pn(e,No,"Navi.start")})),!0}return!1}},defaults:{coordType:"katec",vehicleType:1,rpOption:100,routeInfo:!1}},share:{required:{name:rt,x:ct,y:ct},optional:{coordType:wt(Ko),rpflag:rt,cid:rt,guideId:ct},defaults:{coordType:"katec"}}};function Go(){return{appkey:an(),apiver:"1.0",extras:{KA:nn}}}function $o(e,t){var n={urlScheme:e,intentURI:["intent:".concat(e,"#Intent"),"S.browser_fallback_url=".concat(encodeURIComponent(t)),"end;"].join(";"),storeURL:t,universalLink:t};try{Xr(n)}catch(e){}}var Jo=sn([Object.freeze({__proto__:null,share:function(e){var t=_t(function(e){var t={name:e.name,x:e.x,y:e.y,rpflag:e.rpflag,cid:e.cid,guide_id:e.guideId},n={route_info:!0,coord_type:e.coordType};return jt(jt({},Go()),{},{param:{destination:t,option:n}})}(e=pn(e,Ho.share,"Navi.share")));$o("".concat(rn.naviScheme,"?").concat(t),"".concat(rn.naviFallback,"?").concat(t))},start:function(e){var t=_t(function(e){var t={name:e.name,x:e.x,y:e.y,rpflag:e.rpflag,cid:e.cid,guide_id:e.guideId},n={coord_type:e.coordType,vehicle_type:e.vehicleType,rpoption:e.rpOption,route_info:e.routeInfo,s_x:e.sX,s_y:e.sY,s_angle:e.sAngle,return_uri:e.returnUri};return jt(jt({},Go()),{},{param:{destination:t,option:n,via_list:e.viaPoints}})}(e=pn(e,Ho.start,"Navi.start")));$o("".concat(rn.naviScheme,"?").concat(t),"".concat(rn.naviFallback,"?").concat(t))}})]);function Wo(e){return at(e)&&e>0&&e<101}function Xo(e){if(e.maxPickableCount-1)throw new un('"open" is not allowed in "chatFilters"');if((t.indexOf("direct")>-1||t.indexOf("multi")>-1)&&-1===t.indexOf("regular"))throw new un('"regular" should be included in "chatFilters"')}}var Zo=["none","invitable","registered"],Qo=["talk","story","talkstory"],ei=["chat","chatMember"],ti=["regular","direct","multi","open"],ni=["all","ios","android"],ri={returnUrl:rt,friendFilter:wt(Zo),serviceTypeFilter:wt(Qo),title:rt,enableSearch:ot,countryCodeFilters:m,usingOsFilter:wt(ni),showMyProfile:ot,showFavorite:ot,disableSelectOptions:Vo,displayAllProfile:ot,enableBackButton:ot},oi={optional:{friendFilter:wt(Zo),serviceTypeFilter:wt(Qo),countryCodeFilters:m,usingOsFilter:wt(ni),showMyProfile:ot,showFavorite:ot,showPickedFriend:ot}},ii={optional:{selectionType:wt(ei),chatFilters:function(e){return m(e)&&dt(e,(function(e){return wt(ti)(e)}))}},defaults:{selectionType:ei[0],chatFilters:[ti[0]]},after:Yo},ai={selectFriend:{optional:ri},selectFriends:{optional:jt(jt({},ri),{},{showPickedFriend:ot,maxPickableCount:Wo,minPickableCount:Wo}),after:Xo},selectChat:{optional:{returnUrl:rt,selectionType:wt(ei),chatFilters:function(e){return m(e)&&dt(e,(function(e){return wt(ti)(e)}))},title:rt,enableSearch:ot,disableSelectOptions:Vo,displayAllProfile:ot,maxPickableCount:Wo,minPickableCount:Wo,enableBackButton:ot},defaults:{selectionType:ei[0],chatFilters:[ti[0]]},after:function(e){Xo(e),Yo(e)}},select:{optional:{returnUrl:rt,title:rt,enableSearch:ot,disableSelectOptions:Vo,displayAllProfile:ot,maxPickableCount:Wo,minPickableCount:Wo,enableBackButton:ot,friendsParams:function(e){return h(e)&&!!pn(e,oi,"Picker.select")},chatParams:function(e){return h(e)&&!!pn(e,ii,"Picker.select")}},after:Xo}},ci=["returnUrl","friendsParams","chatParams"];var ui=new Or(rn.pickerDomain);function si(e,t){var n=fn(60),r=jt(jt({transId:n,appKey:an(),ka:nn},sr()&&{token:sr()}),function(e){e.returnUrl;var t=e.friendsParams,n=e.chatParams,r=Bt(e,ci);return function(e){["countryCodeFilters","chatFilters"].forEach((function(t){void 0!==e[t]&&(e[t]=e[t].join(","))})),e.disableSelectOptions&&(e.disableSelectOptions=JSON.stringify(e.disableSelectOptions));return e}(jt(jt(jt({},r),t),n))}(e));if(!e.returnUrl)return ui.createHiddenIframe(n,"/proxy?transId=".concat(n)),ui.retrieveMessage(t,r,"picker");r.returnUrl=e.returnUrl,bn(rn.pickerDomain+t,r)}var li=sn([Object.freeze({__proto__:null,select:function(e){return si(e=pn(e,ai.select,"Picker.select"),"/tab/select")},selectChat:function(e){return si(e=pn(e,ai.selectChat,"Picker.selectChat"),"/chat/select")},selectFriend:function(e){return si(e=pn(e,ai.selectFriend,"Picker.selectFriend"),"/select/single")},selectFriends:function(e){return si(e=pn(e,ai.selectFriends,"Picker.selectFriends"),"/select/multiple")}})]);function pi(){return null!==an()}"function"==typeof define&&define.amd&&(window.Kakao=e),"function"==typeof window.kakaoAsyncInit&&setTimeout((function(){window.kakaoAsyncInit()}),0),e.VERSION=en,e.cleanup=function(){var e=this;Object.keys(this).filter((function(t){return h(e[t])})).forEach((function(t){return e[t].cleanup&&e[t].cleanup()})),cn(null)},e.init=function(e){if(Zt.browser.msie&&Zt.browser.version.major<11)throw new un("Kakao.init: Unsupported browser");if(pi())throw new un("Kakao.init: Already initialized");if(!rt(e))throw new un("Kakao.init: App key must be provided");cn(e),this.Auth=Tr,this.API=Cr,this.Share=go,this.Channel=zo,this.Story=Mo,this.Navi=Jo,this.Picker=li},e.isInitialized=pi}));